package org.vacoor.xqq.core.msg.resp;

/**
 * 数据传输对象, 主要用于接收服务器响应
 *
 * User: Vacoor
 */

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
 */
public class FriendsRs {
    @JsonProperty("friends")
    private List<CategoryFriendDTO> friends;
    private List<FriendMarknameDTO> marknames;
    private List<CategoryDTO> categories;
    private List<BasicFriendInfoDTO> info;

    public List<CategoryFriendDTO> getFriends() {
        return friends;
    }

    public void setFriends(List<CategoryFriendDTO> friends) {
        this.friends = friends;
    }

    public List<FriendMarknameDTO> getMarknames() {
        return marknames;
    }

    public void setMarknames(List<FriendMarknameDTO> marknames) {
        this.marknames = marknames;
    }

    public List<CategoryDTO> getCategories() {
        return categories;
    }

    public void setCategories(List<CategoryDTO> categories) {
        this.categories = categories;
    }

    public List<BasicFriendInfoDTO> getInfo() {
        return info;
    }

    public void setInfo(List<BasicFriendInfoDTO> basicFriendInfoDTO) {
        this.info = basicFriendInfoDTO;
    }

    /**
     * 好友和分组对应关系
     */
    public static class CategoryFriendDTO {
        private long flag;
        private long uin;   // 好友uin

        @JsonProperty("categories")
        private int category;   // 所属分组索引

        public long getFlag() {
            return flag;
        }

        public void setFlag(long flag) {
            this.flag = flag;
        }

        public long getUin() {
            return uin;
        }

        public void setUin(long uin) {
            this.uin = uin;
        }

        public int getCategory() {
            return category;
        }

        public void setCategory(int category) {
            this.category = category;
        }

        @Override
        public String toString() {
            return "CategoryFriendDTO{" +
                    "flag=" + flag +
                    ", uin=" + uin +
                    ", category=" + category +
                    '}';
        }
    }

    /**
     * 好友备注
     */
    public static class FriendMarknameDTO {
        private long uin;
        private String markname;
        private int type;

        public long getUin() {
            return uin;
        }

        public void setUin(long uin) {
            this.uin = uin;
        }

        public String getMarkname() {
            return markname;
        }

        public void setMarkname(String markname) {
            this.markname = markname;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        @Override
        public String toString() {
            return "FriendMarknameDTO{" +
                    "uin=" + uin +
                    ", markname='" + markname + '\'' +
                    ", type=" + type +
                    '}';
        }
    }

    /**
     * 分组信息
     */
    public static class CategoryDTO {
        private int index;
        private int sort;
        private String name;
        private int onlineCount;

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public int getSort() {
            return sort;
        }

        public void setSort(int sort) {
            this.sort = sort;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @Override
        public String toString() {
            return "CategoryDTO{" +
                    "index=" + index +
                    ", sort=" + sort +
                    ", name='" + name + '\'' +
                    '}';
        }

        public void setOnlineCount(int onlineCount) {
            this.onlineCount = onlineCount;
        }

        public int getOnlineCount() {
            return onlineCount;
        }
    }

    public static class BasicFriendInfoDTO {
        private int face;
        private long flag;
        private String nick;
        private long uin;

        public int getFace() {
            return face;
        }

        public void setFace(int face) {
            this.face = face;
        }

        public long getFlag() {
            return flag;
        }

        public void setFlag(long flag) {
            this.flag = flag;
        }

        public String getNick() {
            return nick;
        }

        public void setNick(String nick) {
            this.nick = nick;
        }

        public long getUin() {
            return uin;
        }

        public void setUin(long uin) {
            this.uin = uin;
        }

        @Override
        public String toString() {
            return "BasicFriendInfoDTO{" +
                    "face=" + face +
                    ", flag=" + flag +
                    ", nick='" + nick + '\'' +
                    ", uin=" + uin +
                    '}';
        }
    }
}
